#pragma once

#include <iostream>
using namespace std ;

#include "Quadrant.h"

class Missile
{
private:
	int m_PosX ;
	int m_PosY ;

	int m_StartX ;
	int m_StartY ;

	int m_TargetX ;
	int m_TargetY ;
public:
	Missile( ) ;
	~Missile( ) { }

	void Init( int startX, int startY, int targetX, int targetY ) ;

	void Move( Quadrant* currQuad ) ;

	int GetDistance( ) ;
	int GetPosX( ) {return m_PosX ;}
	int GetPosY( ) {return m_PosY ;}

	bool ReachedTarget( ) { return ( m_PosX == m_TargetX && m_PosY == m_TargetY ) ; }
	bool CollisionEnemy( Quadrant* currQuad ) { return currQuad->GetSector( m_PosX, m_PosY ) == ENEMY ; }
	bool CollisionStar( Quadrant* currQuad ) { return currQuad->GetSector( m_PosX, m_PosY ) == STAR ; }
} ;